package com.example.demo3.V3;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {
    @Bean
    public Student s3(){
        return new Student("酷酷的森",20);
    }
    @Bean
    public String name(){
        return "yangsen";
    }
    @Bean
    public String name2(){
        return "zhangzan";
    }
    @Bean
    public Student s2(@Qualifier("name2") String n){
        return new Student(n,21);
    }
}
